package com.junzhiit.nengji.shop.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum ShopClientStatus {
	UNMEMBER(0,"非会员"),
	MEMBER(1,"会员"),
	NOT_ACTIVE(2,"未激活");
	
	private Integer status;
	
	private String value;

	private ShopClientStatus(Integer status,String value){
		this.status = status;
		this.value = value;
	}

	public int toIntStatus() {
		return this.status;
	}
	
	public String toStringValue() {
		return this.value;
	}

	public static ShopClientStatus toStatus(int status) {
		if (UNMEMBER.status == status) {
			return UNMEMBER;
		} else if (MEMBER.status == status) {
			return MEMBER;
		}else if (NOT_ACTIVE.status == status) {
			return NOT_ACTIVE;
		} else {
			throw new InvalidArgumentException("Unknown status[" + status + "].");
		}
	}
}
